	IDENTIFICATION DIVISION.
	PROGRAM-ID. PGM4.
	DATE-WRITTEN. JUNIO 2013.
	
	ENVIRONMENT DIVISION.
	CONFIGURATION SECTION.
	SPECIAL-NAMES.
	    DECIMAL-POINT IS COMMA.
	INPUT-OUTPUT SECTION.    
        FILE-CONTROL.
            SELECT ESTCLIENTE   ASSIGN TO 'C:\ECL.DAT'
				ORGANIZATION IS INDEXED
				ACCESS MODE IS DYNAMIC
				RECORD KEY IS ECL-CLAVE
				FILE STATUS IS WSS-FS-ESTCLIENTE.
				
	DATA DIVISION.
       FILE SECTION.
        FD ESTCLIENTE           DATA RECORD IS ECL
                                 LABEL RECORD IS STANDARD.
         01 ECL.
            05 ECL-CLAVE.
               10 ECL-COD-CLI       PIC 9(8).
               10 ECL-NRO-SEC       PIC 9(4).
            05 ECL-FECHA-DES.
               10 ECL-ANIO-DES      PIC X(4).
               10 FILLER            PIC X.
               10 ECL-MES-DES       PIC X(2).
               10 FILLER            PIC X.
               10 ECL-DIA-DES       PIC X(2).
            05 ECL-FECHA-HAS.
               10 ECL-ANIO-HAS      PIC X(4).
               10 FILLER            PIC X.
               10 ECL-MES-HAS       PIC X(2).
               10 FILLER            PIC X.
               10 ECL-DIA-HAS       PIC X(2).
            05 ECL-CATEG-HAB        PIC 9(4).
            05 ECL-IMPORTE          PIC S9(06)V99.
	
       WORKING-STORAGE SECTION.
	01 WSS-FS-ESTCLIENTE		PIC X(02).
	PROCEDURE DIVISION.
	COMIENZO.
	    OPEN OUTPUT ESTCLIENTE.
	    
	    PERFORM CARGAR-ECL.
	    
	    STOP RUN.
	    
	 CARGAR-ECL.   
	    INITIALIZE ECL. 
	    MOVE 12345633              TO ECL-COD-CLI.
	    MOVE 0001                  TO ECL-NRO-SEC.
	    MOVE '2010-03-03'          TO ECL-FECHA-DES.
	    MOVE '2010-03-10'          TO ECL-FECHA-HAS.
	    MOVE 0039                  TO ECL-CATEG-HAB.
	    MOVE +002348,99            TO ECL-IMPORTE.

	    WRITE ECL. 
		
	    INITIALIZE ECL REPLACING ALPHANUMERIC DATA BY SPACES
	                                   NUMERIC DATA BY ZEROS.
	    MOVE 00005633              TO ECL-COD-CLI.
 	    MOVE 0009                  TO ECL-NRO-SEC.
	    MOVE '2013-02-29'          TO ECL-FECHA-DES.
	    MOVE '2013-03-14'          TO ECL-FECHA-HAS.
	    MOVE 0013                  TO ECL-CATEG-HAB.
	    MOVE +002035,00              TO ECL-IMPORTE.

	    WRITE ECL.
	    
	    